home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 039a / mawk10.zip / IDEFAULT.H < prev    next >
C/C++ Source or Header  |  1991-10-05  |  5KB  |  228 lines

  1.  
  2. /********************************************
  3. Idefault.h
  4. copyright 1991, Michael D. Brennan
  5.  
  6. This is a source file for mawk, an implementation of
  7. the AWK programming language.
  8.  
  9. Mawk is distributed without warranty under the terms of
  10. the GNU General Public License, version 2, 1991.
  11. ********************************************/
  12.  
  13.  
  14. /* $Log:    Idefault.h,v $
  15.  * Revision 3.7.1.1  91/09/25  12:59:16  brennan
  16.  * VERSION 1.0
  17.  * 
  18.  * Revision 3.7  91/08/16  08:49:51  brennan
  19.  * Carl's addition of SW_FP_CHECK for XNX23A
  20.  * 
  21.  * Revision 3.6  91/08/13  09:04:05  brennan
  22.  * VERSION .9994
  23.  * 
  24.  * Revision 3.5  91/08/03  06:10:46  brennan
  25.  * changed CHECK_DIVZERO macro
  26.  * 
  27.  * Revision 3.4  91/08/03  05:35:59  brennan
  28.  * changed name to Idefault.h 
  29.  * 
  30.  * Revision 3.3  91/06/28  04:36:28  brennan
  31.  * adjustments with __STDC__
  32.  * 
  33.  * Revision 3.3  91/06/19  10:21:37  brennan
  34.  * changes for xenix_r2.h and gcc
  35.  * 
  36.  * Revision 3.2  91/06/15  09:24:34  brennan
  37.  * Carl's diffs for V7
  38.  * 
  39.  * 06/11/91  C. Mascott        add default D2BOOL
  40.  *
  41.  * Revision 3.1  91/06/07  10:38:46  brennan
  42.  * VERSION 0.995
  43.  * 
  44. */
  45.  
  46. /* The most common configuration is defined here:
  47.  
  48.    no function prototypes
  49.    have void*
  50.    have matherr(), strtod(), fmod()
  51.    uses <varargs.h>
  52.  
  53.    fpe_traps default to off
  54.  
  55.    memory is not small
  56.  
  57.    OS is some flavor of Unix
  58.  
  59. */
  60.  
  61. /* WARNING:  To port to a new configuration, don't make changes
  62.    here.  This file is included at the end of your new 
  63.    config.h 
  64.  
  65.    Read the file   mawk/INSTALL
  66. */
  67.  
  68.  
  69. /*------------- compiler ----------------------------*/
  70. /* do not have function prototypes */
  71.  
  72. #ifndef  HAVE_PROTOS
  73. #define  HAVE_PROTOS        0
  74. #endif
  75.  
  76. /* have type   void *    */
  77. #ifndef  HAVE_VOID_PTR
  78. #define  HAVE_VOID_PTR        1
  79. #endif
  80.  
  81. /* logical test of double is OK */
  82. #ifndef D2BOOL
  83. #define D2BOOL(x)        (x)
  84. #endif
  85.  
  86. /*---------------- library ----------------------*/
  87.  
  88.  
  89. #ifndef  HAVE_MATHERR
  90. #define  HAVE_MATHERR        1
  91. #endif
  92.  
  93. #ifndef  HAVE_STRTOD
  94. #define  HAVE_STRTOD        1
  95. #endif
  96.  
  97. #ifndef  HAVE_FMOD
  98. #define  HAVE_FMOD        1
  99. #endif
  100.  
  101. /* uses <varargs.h> instead of <stdarg.h> */
  102. #ifndef  HAVE_STDARG_H    
  103. #define  HAVE_STDARG_H        0
  104. #endif
  105.  
  106. /* has <string.h>, 
  107.    doesn't have <stdlib.h>  
  108.    has <fcntl.h>
  109. */
  110.  
  111. #ifndef  HAVE_STRING_H
  112. #define  HAVE_STRING_H        1
  113. #endif
  114.  
  115. #ifndef  HAVE_STDLIB_H
  116. #define  HAVE_STDLIB_H        0
  117. #endif
  118.  
  119. #ifndef  HAVE_FCNTL_H
  120. #define  HAVE_FCNTL_H        1
  121. #endif
  122.  
  123. /*------------- machine ------------------------*/
  124.  
  125. /* default is IEEE754 and data space is not scarce */
  126.  
  127. #ifndef  FPE_TRAPS_ON
  128. #define  FPE_TRAPS_ON        0
  129. #endif
  130.  
  131. #ifndef   NOINFO_SIGFPE
  132. #define   NOINFO_SIGFPE        0
  133. #endif
  134.  
  135. #if   ! FPE_TRAPS_ON
  136. #undef   NOINFO_SIGFPE  
  137. #define  NOINFO_SIGFPE          0 /* make sure no one does
  138.                      something stupid */
  139. #endif
  140.  
  141. #if      NOINFO_SIGFPE
  142. #define  CHECK_DIVZERO(x)    if( (x) == 0.0 )rt_error(dz_msg);else
  143. #endif
  144.  
  145. /* SW_FP_CHECK is specific to V7 and XNX23A
  146.     (1) is part of STDC_MATHERR def.
  147.     (2) enables calls to XENIX-68K 2.3A clrerr(), iserr()
  148.  */
  149. #ifndef  SW_FP_CHECK
  150. #define  SW_FP_CHECK        0
  151. #endif
  152.  
  153. #ifndef  TURN_OFF_FPE_TRAPS
  154. #define  TURN_OFF_FPE_TRAPS()    /* nothing */
  155. #endif
  156.  
  157. #ifndef  HAVE_SMALL_MEMORY
  158. #define  HAVE_SMALL_MEMORY    0
  159. #endif
  160.  
  161.  
  162. /*------------------------------------------------*/
  163.  
  164.  
  165. #ifndef  __STDC__
  166. #define  __STDC__  0
  167. #endif
  168.  
  169. #if   __STDC__  
  170.  
  171. #undef  HAVE_PROTOS
  172. #define HAVE_PROTOS        1
  173. #undef  HAVE_VOID_PTR
  174. #define HAVE_VOID_PTR        1
  175. #undef  HAVE_STDARG_H
  176. #define HAVE_STDARG_H        1
  177. #undef  HAVE_STRING_H
  178. #define HAVE_STRING_H        1
  179. #endif  
  180.  
  181. #if   __STDC__  &&  ! __GNUC__
  182. /* with gcc __STDC__ can be defined, but stdlib.h is missing */
  183. #undef  HAVE_STDLIB_H
  184. #define HAVE_STDLIB_H        1
  185. #endif
  186.  
  187.  
  188.  
  189.  
  190. /* the painfull case: we need to catch fpe's and look at errno
  191.    after lib calls */
  192.  
  193. #define  STDC_MATHERR    ((SW_FP_CHECK || FPE_TRAPS_ON) && HAVE_MATHERR==0)
  194.  
  195. #ifndef  MSDOS
  196. #define  MSDOS        0
  197. #endif
  198.  
  199. #if    MSDOS
  200. #ifndef  HAVE_REARGV
  201. #define  HAVE_REARGV    0
  202. #endif
  203. #endif
  204.  
  205.  
  206. #if  HAVE_PROTOS
  207. #define  PROTO(name, args)  name  args
  208. #else
  209. #define  PROTO(name, args)  name()
  210. #endif
  211.  
  212. /* ultrix pukes if __STDC__ is defined 0  */
  213. /* SCO UNIX's cc (from Microsoft) sneezes if __STDC__ is re-#define-d */
  214. #if (__STDC__ == 0)
  215. #ifndef M_I386
  216. #undef __STDC__
  217. #endif
  218. #endif
  219.  
  220. /* for Think C on the Macintosh, sizeof(size_t) != sizeof(unsigned
  221.  * Rather than unilaterally imposing size_t, when not all compilers would
  222.  * necessarily have it defined, we use the SIZE_T() macro where appropriate
  223.  * to typecast function arguments
  224.  */
  225. #ifndef SIZE_T
  226. #define SIZE_T(x) (x)
  227. #endif
  228.